import request from '@/utils/request'

export function getOrderList(params) {
  return request({
    url: '/order',
    method: 'get',
    params
  })
}

export function getOrderInfo(id) {
  return request({
    url: '/order',
    method: 'get',
    params: {
      id: id
    }
  })
}

export function getProfitData(year) {
  return request({
    url: '/order/echartsData',
    method: 'get',
    params: {
      year: year
    }
  })
}

export function modifyOrderStatus(id, payload) {
  return request({
    url: '/order',
    method: 'put',
    params: {
      id: id
    },
    data: {
      status: payload.status,
      beautyProgress: payload.beautyProgress,
      materialIdList: payload.materialIdList ? payload.materialIdList : ''
    }
  })
}

